// pages/classes/classes.js
var screenHeight;
var app=getApp();
var util = require("../../utils/util.js");
var baseImgUrl = util.baseImgUrl;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    baseImgUrl : util.baseImgUrl,
    activeIndex:0,//默认选中第一个标签
    navlist: [{
      id: "0",
      name: "推荐",
    },
    {
      id: "1",
      name: "美妆达人",
    },
    {
      id: "2",
      name: "鞋子",
    }, {
      id: "3",
      name: "饰品包包",
    }, {
      id: "4",
      name: "美容护肤",
    }, {
      id: "5",
      name: "健身达人",
    }, {
      id: "6",
      name: "旅游",
      }, {
        id: "0",
        name: "推荐",
      },
      {
        id: "1",
        name: "美妆达人",
      },
      {
        id: "2",
        name: "鞋子",
      }, {
        id: "3",
        name: "饰品包包",
      }, {
        id: "4",
        name: "美容护肤",
      }, {
        id: "5",
        name: "健身达人",
      }, {
        id: "6",
        name: "旅游",
      }],
      lists:[
        {
          id:0,
          title:"分类推荐",
          subList:[
            {
              subid:101,
              picurl:baseImgUrl+"goods1.png",
              name:"洁面"
            },
            {
              subid: 102,
              picurl: baseImgUrl + "goods2.png",
              name: "面膜"
            },
            {
              subid: 103,
              picurl: baseImgUrl + "goods1.png",
              name: "眼影"
            },
            {
              subid: 104,
              picurl: baseImgUrl + "goods2.png",
              name: "卸妆"
            }
          ]

        }, {
          id: 2,
          title: "品牌推荐",
          subList: [
            {
              subid: 101,
              picurl: baseImgUrl + "goods1.png",
              name: "城野医生"
            },
            {
              subid: 102,
              picurl: baseImgUrl + "goods2.png",
              name: "兰芝"
            },
            {
              subid: 103,
              picurl: baseImgUrl + "goods1.png",
              name: "兰蔻"
            },
            {
              subid: 104,
              picurl: baseImgUrl + "goods2.png",
              name: "欧舒丹"
            }, {
              subid: 105,
              picurl: baseImgUrl + "goods1.png",
              name: "城野医生"
            },
            {
              subid: 106,
              picurl: baseImgUrl + "goods2.png",
              name: "科颜氏"
            },
            {
              subid: 107,
              picurl: baseImgUrl + "goods1.png",
              name: "雅诗兰黛"
            },
            {
              subid: 108,
              picurl: baseImgUrl + "goods2.png",
              name: "碧欧泉"
            },
            {
              subid: 108,
              picurl: baseImgUrl + "goods2.png",
              name: "娇韵诗"
            }
          ]

        }
      ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that=this;
    wx.getSystemInfo({
      success: function(res) {
        console.log("---------------systemInfo----------")
        console.log(res)
        screenHeight = res.windowHeight;
        that.setData({
          screenHeight: screenHeight
        })
      },
    })
  },

  /*************点击切换左侧导航********* */
  choseNav:function(e){
     console.log(e);
     var activeIndex=e.currentTarget.dataset.index;
     var that=this;
     that.setData({
       activeIndex:activeIndex
     })
     util.loading();

     //请求接口

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})